package top.yxqz.number2.service.imp;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.yxqz.number2.dao.UserDao;
import top.yxqz.number2.entity.User;
import top.yxqz.number2.service.UserService;

/**
 * @author: 余小小
 * @date: 2023/9/18
 * @description：用户实现类
 */
@Service
public class UserServiceImp implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public User getUser() {
//        调用 数据层 来得到数据
        User user = userDao.getUser();
//        将admin改成管理员
        if ("admin".equals(user.getUsrName())) {
            user.setUsrName("管理员");
        }
        return user;
    }
}
